package com.zmn.mcc.model.entity.staff.log;

import com.zmn.common.utils.pager.LayuiPage;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * 员工操作日志
 *
 * @author quanjic
 * @version v1.0
 * @since 2019/7/8 15:55
 **/
public class StaffLogQuery extends LayuiPage {

    private Integer staffId;
    private String staffName;
    private String realName;
    private Integer companyId;
    private Integer plat;
    private Integer deptId;
    private String deptName;

    private String uri;
    private Date startTime;
    private Date endTime;

    private String app;
    private String ip;

    private Integer deptOneId;
    private Integer deptTwoId;

    private static final long serialVersionUID = 1L;

    public Integer getStaffId() {
        return staffId;
    }

    public void setStaffId(Integer staffId) {
        this.staffId = staffId;
    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public Integer getPlat() {
        return plat;
    }

    public void setPlat(Integer plat) {
        this.plat = plat;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        if (startTime == "" || startTime == null) {
            this.startTime = null;
        }else{
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            try {
                this.startTime = sdf.parse(startTime);
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        if (endTime == "" || endTime == null) {
            this.endTime = null;
        }else {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            try {
                Calendar calendar = new GregorianCalendar();
                calendar.setTime(sdf.parse(endTime));
                calendar.add(Calendar.DATE, 1);
                this.endTime = calendar.getTime();
            } catch (ParseException e) {
                e.printStackTrace();
            }
        }
    }

    public String getApp() {
        return app;
    }

    public void setApp(String app) {
        this.app = app;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getDeptOneId() {
        return deptOneId;
    }

    public void setDeptOneId(Integer deptOneId) {
        this.deptOneId = deptOneId;
    }

    public Integer getDeptTwoId() {
        return deptTwoId;
    }

    public void setDeptTwoId(Integer deptTwoId) {
        this.deptTwoId = deptTwoId;
    }

    @Override
    public String toString() {
        return "StaffLogQuery{" + "staffId=" + staffId + ", staffName='" + staffName + '\'' + ", realName='" + realName + '\'' + ", companyId=" + companyId + ", plat=" + plat + ", deptId=" + deptId + ", deptName='" + deptName + '\'' + ", uri='" + uri + '\'' + ", startTime=" + startTime + ", endTime=" + endTime + ", app='" + app + '\'' + ", ip='" + ip + '\'' + '}';
    }
}
